-
Notifications
You must be signed in to change notification settings - Fork 300
MCP enhancements: improves server config and adds support for all transport types (stdio, streamable-http) #307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
MCP enhancements: improves server config and adds support for all transport types (stdio, streamable-http) #307
Conversation
22a72eb
to
dd0f744
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR extends the MCP tool wrapper to support stdio mode in addition to the existing SSE mode. Key changes include:
- Updating the MCPToolConfig schema and client builder to support stdio parameters (command, args, env).
- Refactoring the MCP client structure by introducing a base client and a dedicated MCPStdioClient.
- Enhancing CLI commands, tests, and documentation to demonstrate and verify the stdio mode usage.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
tests/aiq/tools/test_mcp.py | Added tests for both SSE and stdio client usage, and for the MCPBuilder functionality. |
src/aiq/tool/mcp/mcp_tool.py | Updated configuration handling to support stdio mode with new parameters and validation. |
src/aiq/tool/mcp/mcp_client.py | Refactored client architecture by introducing a base client and a dedicated MCPStdioClient, and updated MCPBuilder accordingly. |
src/aiq/cli/commands/info/list_mcp.py | Enhanced CLI options to support stdio mode configuration including command, args, and environment variables. |
examples/simple_calculator/src/aiq_simple_calculator/configs/config-mcp-date-stdio.yml | Added sample config demonstrating usage of MCP stdio mode. |
docs/source/workflows/mcp/mcp-client.md | Updated documentation to include examples and explanation for both SSE and stdio mode configurations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could improve design a bit now that we have two client types by removing MCPBuilder
0eea228
to
22f704a
Compare
Sample Usage: aiq info mcp --client-type stdio --command python --args "-m mcp_server_time --local-timezone=America/Los_Angeles" Sample Output: get_current_time convert_time Signed-off-by: Anuradha Karuppiah <[email protected]>
Signed-off-by: Anuradha Karuppiah <[email protected]>
Signed-off-by: Anuradha Karuppiah <[email protected]>
Signed-off-by: Anuradha Karuppiah <[email protected]>
Signed-off-by: Anuradha Karuppiah <[email protected]>
Signed-off-by: Anuradha Karuppiah <[email protected]>
Signed-off-by: Anuradha Karuppiah <[email protected]>
Signed-off-by: Anuradha Karuppiah <[email protected]>
Signed-off-by: Anuradha Karuppiah <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: Anuradha Karuppiah <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: Anuradha Karuppiah <[email protected]>
Signed-off-by: Anuradha Karuppiah <[email protected]>
Signed-off-by: Anuradha Karuppiah <[email protected]>
Signed-off-by: Anuradha Karuppiah <[email protected]>
Signed-off-by: Anuradha Karuppiah <[email protected]>
Signed-off-by: Anuradha Karuppiah <[email protected]>
Signed-off-by: Michael Demoret <[email protected]>
Signed-off-by: Anuradha Karuppiah <[email protected]>
e7aa3f7
to
e5b4d5f
Compare
Signed-off-by: Anuradha Karuppiah <[email protected]>
Signed-off-by: Anuradha Karuppiah <[email protected]>
Start of dynamic_functions Signed-off-by: Anuradha Karuppiah <[email protected]>
30755ab
to
98963be
Compare
This will need some iterating Signed-off-by: Anuradha Karuppiah <[email protected]>
98963be
to
9cbc38a
Compare
Signed-off-by: Anuradha Karuppiah <[email protected]>
Signed-off-by: Anuradha Karuppiah <[email protected]>
Signed-off-by: Anuradha Karuppiah <[email protected]>
Signed-off-by: Anuradha Karuppiah <[email protected]>
If no default is defined in the schema, and the field isn’t in the "required" list, it should default to None (i.e., optional). Earlier logic marked the field as required (using ...) unless "default" is explicitly set i.e. it would mark optional fields with no default as required. Signed-off-by: Anuradha Karuppiah <[email protected]>
Signed-off-by: Anuradha Karuppiah <[email protected]>
Signed-off-by: Anuradha Karuppiah <[email protected]>
Signed-off-by: Anuradha Karuppiah <[email protected]>
22666bd
to
29898aa
Compare
Signed-off-by: Anuradha Karuppiah <[email protected]>
29898aa
to
56092ad
Compare
Signed-off-by: Anuradha Karuppiah <[email protected]>
Signed-off-by: Anuradha Karuppiah <[email protected]>
Description
Closes #304, #314
This PR
mcp_client
function. This function connects to the server, discovers tools and adds them as dynamic functions (mcp_single_tool
) to the AIQ workflow builder.Sample usage (see examples/simple_calculator/configs/config-mcp-date-stdio.yml) -
By Submitting this PR I confirm: